
// https://leetcode-cn.com/problems/fei-bo-na-qi-shu-lie-lcof/
// 裴波那契数列,答案需要取模 1e9+7
function fib(n: number): number {
    const mod = 1000000007
    const arr = [0, 1]

    while (arr.length <= n) {
        let len = arr.length
        arr.push((arr[len - 1] + arr[len - 2]) % mod)
    }

    return arr[n]
};